﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using System.Data.SqlClient;

public partial class MasterPage_ShenBaoBase : System.Web.UI.MasterPage
{
    protected void  Page_Load(object sender, EventArgs e)
    {

    }
    protected void dwmc1_Init(object sender, EventArgs e)
    {
        
        if (Session["qiyeid"] == null || Session["qiyeid"] == "")
        {
            Response.Redirect("~/Default.aspx");
        }
        if (Session["qiyeleixing"] != "ybqy")
        {
            Session["qiyeid"] = null;
            Response.Redirect("~/Default.aspx");
        }

        
        
        SqlConnection sqlcon = new SqlConnection();
        sqlcon.ConnectionString = ConfigurationManager.ConnectionStrings["SqlConnectionString"].ConnectionString;
        sqlcon.Open();

        SqlCommand sqlcmd = new SqlCommand("select * from qiyejibenxingxi where  qyid=" + Session["qiyeid"], sqlcon);

        SqlDataReader reader = sqlcmd.ExecuteReader(CommandBehavior.CloseConnection);

        if (reader.Read())
        {
            dwmc1.Text = reader["dwmc"].ToString();
        }

        sqlcon.Close();



    }
}
